package GUI;

import javax.swing.JPanel;

import logic.Activity;
import logic.Message;
import javax.swing.JLabel;
import java.awt.Font;
import java.awt.Color;
import java.util.ArrayList;

import javax.swing.border.LineBorder;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import javax.swing.UIManager;

public class Activity_Report extends JPanel{
	private Client_GUI parent;
	private JLabel lblcopys;
	
	
	public Activity_Report(final Client_GUI parent,Activity msg,final ResultDisplay returnPanel) {
		setBackground(UIManager.getColor("inactiveCaption"));
		this.parent = parent;
		this.setSize(Client_GUI.MAIN_WIDTH, Client_GUI.MAIN_HEIGHT);
		setLayout(null);
		
		
		JLabel lblActivityRerortFor = new JLabel("Activity Rerort for:");
		lblActivityRerortFor.setForeground(Color.RED);
		lblActivityRerortFor.setFont(new Font("Tahoma", Font.BOLD, 20));
		lblActivityRerortFor.setBounds(205, 43, 215, 31);
		add(lblActivityRerortFor);
		
		JLabel labelDate = new JLabel(msg.getREPORT_DATE());
		labelDate.setForeground(Color.BLUE);
		labelDate.setFont(new Font("Tahoma", Font.BOLD, 20));
		labelDate.setBounds(430, 43, 188, 31);
		add(labelDate);
		
		JPanel panel = new JPanel();
		panel.setBorder(new LineBorder(new Color(0, 0, 0), 3));
		panel.setBounds(131, 85, 548, 350);
		add(panel);
		panel.setLayout(null);
		
		JLabel lblNumberOfActive = new JLabel("Number of active Member:");
		lblNumberOfActive.setBounds(114, 24, 195, 31);
		panel.add(lblNumberOfActive);
		lblNumberOfActive.setFont(new Font("Tahoma", Font.BOLD, 13));
		
		JLabel lblNumberOfFrozen = new JLabel("Number of frosen members:");
		lblNumberOfFrozen.setBounds(114, 73, 195, 31);
		panel.add(lblNumberOfFrozen);
		lblNumberOfFrozen.setFont(new Font("Tahoma", Font.BOLD, 13));
		
		JLabel lblNumberOfInactive = new JLabel("Number of inactive Member:");
		lblNumberOfInactive.setBounds(114, 126, 195, 31);
		panel.add(lblNumberOfInactive);
		lblNumberOfInactive.setFont(new Font("Tahoma", Font.BOLD, 13));
		
		JLabel lblNumberOfLoaned = new JLabel("Number of Copys :");
		lblNumberOfLoaned.setBounds(114, 188, 195, 31);
		panel.add(lblNumberOfLoaned);
		lblNumberOfLoaned.setFont(new Font("Tahoma", Font.BOLD, 13));
		
		JLabel label = new JLabel("Number of Loaned Copys :");
		label.setBounds(114, 244, 195, 31);
		panel.add(label);
		label.setFont(new Font("Tahoma", Font.BOLD, 13));
		
		JLabel lblNumberOfLate = new JLabel("Number of Late Return:");
		lblNumberOfLate.setBounds(114, 295, 195, 31);
		panel.add(lblNumberOfLate);
		lblNumberOfLate.setFont(new Font("Tahoma", Font.BOLD, 13));
		
		JLabel lblactive = new JLabel(String.valueOf(msg.getACTIVE_MEMBERS()));
		lblactive.setFont(new Font("Tahoma", Font.BOLD, 16));
		lblactive.setBounds(337, 24, 98, 31);
		panel.add(lblactive);
		
		JLabel llblfrosen = new JLabel(String.valueOf(msg.getFROZEN_MEMBERS()));
		llblfrosen.setFont(new Font("Tahoma", Font.BOLD, 16));
		llblfrosen.setBounds(337, 73, 98, 31);
		panel.add(llblfrosen);
		
		JLabel lblinactive = new JLabel(String.valueOf(msg.getINACTIVE_MEMBERS()));
		lblinactive.setFont(new Font("Tahoma", Font.BOLD, 16));
		lblinactive.setBounds(337, 135, 98, 31);
		panel.add(lblinactive);
		
		lblcopys = new JLabel(String.valueOf(msg.getTOTAL_COPIES()));
		lblcopys.setFont(new Font("Tahoma", Font.BOLD, 16));
		lblcopys.setBounds(337, 189, 98, 31);
		panel.add(lblcopys);
		
		JLabel lblloancopy = new JLabel(String.valueOf(msg.getLOANED_COPIES()));
		lblloancopy.setFont(new Font("Tahoma", Font.BOLD, 16));
		lblloancopy.setBounds(337, 244, 98, 31);
		panel.add(lblloancopy);
		
		JLabel lbllatereturn = new JLabel(String.valueOf(msg.getLATE_RETURN_MEMBERS()));
		lbllatereturn.setFont(new Font("Tahoma", Font.BOLD, 16));
		lbllatereturn.setBounds(337, 295, 98, 31);
		panel.add(lbllatereturn);
		
		JButton btnNewButton = new JButton("Back");
		btnNewButton.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				parent.RepaintMain(returnPanel);
			}
		});
		btnNewButton.setFont(new Font("Tahoma", Font.BOLD, 13));
		btnNewButton.setBounds(134, 462, 143, 41);
		add(btnNewButton);
		
		JButton btnDone = new JButton("Done");
		btnDone.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				Home home = new Home(parent,parent.client.publicMessages);
				VerifyDialog verify = new VerifyDialog(parent,home,false);
			}
		});
		btnDone.setFont(new Font("Tahoma", Font.BOLD, 13));
		btnDone.setBounds(536, 462, 143, 41);
		add(btnDone);
		
	}
}
